'use strict';

const Service = require('egg').Service;

class ArticleService extends Service {

    async lists() {
        const { app, ctx } = this;
        return ctx.model.article.find({})
    }

    async add() {

        try {
            // insert 插入数据
            const result = await app.mysql.insert('article', params);
            return result;
          } catch (e) {
            console.log(e);
            return null;
          }

    }


}

module.exports = ArticleService;
